home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / stgevc.z / stgevc
Encoding:
Text File  |  2002-10-03  |  11.1 KB  |  331 lines

  1.  
  2.  
  3.  
  4. SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))                                                          SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      STGEVC - compute some or all of the right and/or left generalized
  10.      eigenvectors of a pair of real upper triangular matrices (A,B)
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE STGEVC( SIDE, HOWMNY, SELECT, N, A, LDA, B, LDB, VL, LDVL, VR,
  14.                         LDVR, MM, M, WORK, INFO )
  15.  
  16.          CHARACTER      HOWMNY, SIDE
  17.  
  18.          INTEGER        INFO, LDA, LDB, LDVL, LDVR, M, MM, N
  19.  
  20.          LOGICAL        SELECT( * )
  21.  
  22.          REAL           A( LDA, * ), B( LDB, * ), VL( LDVL, * ), VR( LDVR, *
  23.                         ), WORK( * )
  24.  
  25. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  26.      These routines are part of the SCSL Scientific Library and can be loaded
  27.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  28.      directs the linker to use the multi-processor version of the library.
  29.  
  30.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  31.      4 bytes (32 bits). Another version of SCSL is available in which integers
  32.      are 8 bytes (64 bits).  This version allows the user access to larger
  33.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  34.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  35.      only one of the two versions; 4-byte integer and 8-byte integer library
  36.      calls cannot be mixed.
  37.  
  38. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  39.      STGEVC computes some or all of the right and/or left generalized
  40.      eigenvectors of a pair of real upper triangular matrices (A,B). The right
  41.      generalized eigenvector x and the left generalized eigenvector y of (A,B)
  42.      corresponding to a generalized eigenvalue w are defined by:
  43.  
  44.              (A - wB) * x = 0  and  y**H * (A - wB) = 0
  45.  
  46.      where y**H denotes the conjugate tranpose of y.
  47.  
  48.      If an eigenvalue w is determined by zero diagonal elements of both A and
  49.      B, a unit vector is returned as the corresponding eigenvector.
  50.  
  51.      If all eigenvectors are requested, the routine may either return the
  52.      matrices X and/or Y of right or left eigenvectors of (A,B), or the
  53.      products Z*X and/or Q*Y, where Z and Q are input orthogonal matrices.  If
  54.      (A,B) was obtained from the generalized real-Schur factorization of an
  55.      original pair of matrices
  56.         (A0,B0) = (Q*A*Z**H,Q*B*Z**H),
  57.      then Z*X and Q*Y are the matrices of right or left eigenvectors of A.
  58.  
  59.      A must be block upper triangular, with 1-by-1 and 2-by-2 diagonal blocks.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))                                                          SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      Corresponding to each 2-by-2 diagonal block is a complex conjugate pair
  75.      of eigenvalues and eigenvectors; only one
  76.      eigenvector of the pair is computed, namely the one corresponding to the
  77.      eigenvalue with positive imaginary part.
  78.  
  79.  
  80. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  81.      SIDE    (input) CHARACTER*1
  82.              = 'R': compute right eigenvectors only;
  83.              = 'L': compute left eigenvectors only;
  84.              = 'B': compute both right and left eigenvectors.
  85.  
  86.      HOWMNY  (input) CHARACTER*1
  87.              = 'A': compute all right and/or left eigenvectors;
  88.              = 'B': compute all right and/or left eigenvectors, and
  89.              backtransform them using the input matrices supplied in VR and/or
  90.              VL; = 'S': compute selected right and/or left eigenvectors,
  91.              specified by the logical array SELECT.
  92.  
  93.      SELECT  (input) LOGICAL array, dimension (N)
  94.              If HOWMNY='S', SELECT specifies the eigenvectors to be computed.
  95.              If HOWMNY='A' or 'B', SELECT is not referenced.  To select the
  96.              real eigenvector corresponding to the real eigenvalue w(j),
  97.              SELECT(j) must be set to .TRUE.  To select the complex
  98.              eigenvector corresponding to a complex conjugate pair w(j) and
  99.              w(j+1), either SELECT(j) or SELECT(j+1) must be set to .TRUE..
  100.  
  101.      N       (input) INTEGER
  102.              The order of the matrices A and B.  N >= 0.
  103.  
  104.      A       (input) REAL array, dimension (LDA,N)
  105.              The upper quasi-triangular matrix A.
  106.  
  107.      LDA     (input) INTEGER
  108.              The leading dimension of array A.  LDA >= max(1, N).
  109.  
  110.      B       (input) REAL array, dimension (LDB,N)
  111.              The upper triangular matrix B.  If A has a 2-by-2 diagonal block,
  112.              then the corresponding 2-by-2 block of B must be diagonal with
  113.              positive elements.
  114.  
  115.      LDB     (input) INTEGER
  116.              The leading dimension of array B.  LDB >= max(1,N).
  117.  
  118.      VL      (input/output) REAL array, dimension (LDVL,MM)
  119.              On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must contain
  120.              an N-by-N matrix Q (usually the orthogonal matrix Q of left Schur
  121.              vectors returned by SHGEQZ).  On exit, if SIDE = 'L' or 'B', VL
  122.              contains:  if HOWMNY = 'A', the matrix Y of left eigenvectors of
  123.              (A,B); if HOWMNY = 'B', the matrix Q*Y; if HOWMNY = 'S', the left
  124.              eigenvectors of (A,B) specified by SELECT, stored consecutively
  125.              in the columns of VL, in the same order as their eigenvalues.  If
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))                                                          SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))
  137.  
  138.  
  139.  
  140.              SIDE = 'R', VL is not referenced.
  141.  
  142.              A complex eigenvector corresponding to a complex eigenvalue is
  143.              stored in two consecutive columns, the first holding the real
  144.              part, and the second the imaginary part.
  145.  
  146.      LDVL    (input) INTEGER
  147.              The leading dimension of array VL.  LDVL >= max(1,N) if SIDE =
  148.              'L' or 'B'; LDVL >= 1 otherwise.
  149.  
  150.      VR      (input/output) REAL array, dimension (LDVR,MM)
  151.              On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must contain
  152.              an N-by-N matrix Q (usually the orthogonal matrix Z of right
  153.              Schur vectors returned by SHGEQZ).  On exit, if SIDE = 'R' or
  154.              'B', VR contains:  if HOWMNY = 'A', the matrix X of right
  155.              eigenvectors of (A,B); if HOWMNY = 'B', the matrix Z*X; if HOWMNY
  156.              = 'S', the right eigenvectors of (A,B) specified by SELECT,
  157.              stored consecutively in the columns of VR, in the same order as
  158.              their eigenvalues.  If SIDE = 'L', VR is not referenced.
  159.  
  160.              A complex eigenvector corresponding to a complex eigenvalue is
  161.              stored in two consecutive columns, the first holding the real
  162.              part and the second the imaginary part.
  163.  
  164.      LDVR    (input) INTEGER
  165.              The leading dimension of the array VR.  LDVR >= max(1,N) if SIDE
  166.              = 'R' or 'B'; LDVR >= 1 otherwise.
  167.  
  168.      MM      (input) INTEGER
  169.              The number of columns in the arrays VL and/or VR. MM >= M.
  170.  
  171.      M       (output) INTEGER
  172.              The number of columns in the arrays VL and/or VR actually used to
  173.              store the eigenvectors.  If HOWMNY = 'A' or 'B', M is set to N.
  174.              Each selected real eigenvector occupies one column and each
  175.              selected complex eigenvector occupies two columns.
  176.  
  177.      WORK    (workspace) REAL array, dimension (6*N)
  178.  
  179.      INFO    (output) INTEGER
  180.              = 0:  successful exit.
  181.              < 0:  if INFO = -i, the i-th argument had an illegal value.
  182.              > 0:  the 2-by-2 block (INFO:INFO+1) does not have a complex
  183.              eigenvalue.
  184.  
  185. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  186.      Allocation of workspace:
  187.      ---------- -- ---------
  188.  
  189.         WORK( j ) = 1-norm of j-th column of A, above the diagonal
  190.         WORK( N+j ) = 1-norm of j-th column of B, above the diagonal
  191.         WORK( 2*N+1:3*N ) = real part of eigenvector
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))                                                          SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))
  203.  
  204.  
  205.  
  206.         WORK( 3*N+1:4*N ) = imaginary part of eigenvector
  207.         WORK( 4*N+1:5*N ) = real part of back-transformed eigenvector
  208.         WORK( 5*N+1:6*N ) = imaginary part of back-transformed eigenvector
  209.  
  210.      Rowwise vs. columnwise solution methods:
  211.      ------- --  ---------- -------- -------
  212.  
  213.      Finding a generalized eigenvector consists basically of solving the
  214.      singular triangular system
  215.  
  216.       (A - w B) x = 0     (for right) or:   (A - w B)**H y = 0  (for left)
  217.  
  218.      Consider finding the i-th right eigenvector (assume all eigenvalues are
  219.      real). The equation to be solved is:
  220.           n                   i
  221.      0 = sum  C(j,k) v(k)  = sum  C(j,k) v(k)     for j = i,. . .,1
  222.          k=j                 k=j
  223.  
  224.      where  C = (A - w B)  (The components v(i+1:n) are 0.)
  225.  
  226.      The "rowwise" method is:
  227.  
  228.      (1)  v(i) := 1
  229.      for j = i-1,. . .,1:
  230.                              i
  231.          (2) compute  s = - sum C(j,k) v(k)   and
  232.                            k=j+1
  233.  
  234.          (3) v(j) := s / C(j,j)
  235.  
  236.      Step 2 is sometimes called the "dot product" step, since it is an inner
  237.      product between the j-th row and the portion of the eigenvector that has
  238.      been computed so far.
  239.  
  240.      The "columnwise" method consists basically in doing the sums for all the
  241.      rows in parallel.  As each v(j) is computed, the contribution of v(j)
  242.      times the j-th column of C is added to the partial sums.  Since FORTRAN
  243.      arrays are stored columnwise, this has the advantage that at each step,
  244.      the elements of C that are accessed are adjacent to one another, whereas
  245.      with the rowwise method, the elements accessed at a step are spaced LDA
  246.      (and LDB) words apart.
  247.  
  248.      When finding left eigenvectors, the matrix in question is the transpose
  249.      of the one in storage, so the rowwise method then actually accesses
  250.      columns of A and B at each step, and so is the preferred method.
  251.  
  252.  
  253. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  254.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))                                                          SSSSTTTTGGGGEEEEVVVVCCCC((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      This man page is available only online.
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.